package com.smcaiot.jfttask.domain;

import lombok.Data;

/**
 * @Author: cz
 * @Date: 2023/10/8
 * @Description:
 */
@Data
public class TaskCycle {
    private CycleType cycleType;
    private CycleLength cycleLength;

    public TaskCycle(int length) {
        this.cycleLength = CycleLength.getByCode(length);
        this.cycleType = cycleLength.getCode() <= 0 ? CycleType.TASK_CYCLE_ONCE : CycleType.TASK_CYCLE_LOOP;
    }
}
